package com.company.module.bussiness.impl;

import java.util.List;

import com.company.module.dao.BaseDAO;
import com.company.module.model.Group;
import com.company.module.model.Student;
import com.company.module.model.User;


public class Test002 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Student s = new Student();
		System.out.println("ccc:"+s.getClass().getName());
		Class c;
		BaseDAO dao = new BaseDAO(new Student());
		BaseDAO dao2 = new BaseDAO(new User());
		User u = new User();
		u.setUserid(88);
		u.setUsername("88");
		u.setPassword("88");
		u.setGroupid(88);
		Group g = new Group();
		g.setGroupid(88);
		g.setGroupname("group88");
		dao.save(u);
		dao.save(g);
		try {
			String sql = "SELECT * FROM `user` u,`group` g  where  u.groupid = g.groupid";
			List<List> list = dao.executeSql(sql);
			for(int i=0;i<list.size();i++){
				List content = list.get(i);
				for(int j=0;j<content.size();j++){
					System.out.print(content.get(j)+"/////");
				}
				System.out.println();
			}
			
//			Student s2 = new Student();
//			s2.setId(11);
//			s2.setName("11");
//			s2.setAge(11);
//			dao.save(s2);
//			User u = new User();
//			u.setUserid(0);
//			u.setGroupid(4);
			//dao.delete(s2);
			//s2.setAge(2);
			//s2.setName("11");
//			List<Object> list = dao.findByExample(s2);
//			for(int i=0;i<list.size();i++){
//				Student s3 = (Student)list.get(i);
//				System.out.println(s3.getName());
//			}
			
			//System.out.println(u.getUsername());
			
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}

}
